﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using Devonline.Entity;

namespace Web.Models
{
    /// <summary>
    /// 订单明细表
    /// </summary>
    [Table("order_detail")]
    public class OrderDetail : EntitySetWithCreate
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        [Column("order_id"), DisplayName("订单编号"), MaxLength(36)]
        public string OrderId { get; set; }
        /// <summary>
        /// 商品
        /// </summary>
        [Column("product"), DisplayName("商品"), Required, MaxLength(128)]
        public string Product { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        [Column("price", TypeName = "DECIMAL(6,2)"), DisplayName("单价")]
        public decimal Price { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        [Column("Count"), DisplayName("数量")]
        public int Count { get; set; }

        /// <summary>
        /// 订单
        /// </summary>
        public virtual Order Order { get; set; }
    }
}
